// Vue.component('show-detail', {
//     template: `<el-dialog title="明细查询" :visible.sync="visibleDialog" width="80vw">
//     <el-table :data="tableData" stripe border min-height="50vh" style="width: 100%">
//         <el-table-column align="center" type="index" label="序号" width="50"></el-table-column>
//         <el-table-column align="center" prop="Article_Specifications_SerialNumber" width="200" show-overflow-tooltip label="规格流水号"></el-table-column>
//         <el-table-column align="center" prop="BarCode" show-overflow-tooltip label="条码"></el-table-column>
//         <el-table-column align="center" prop="Specifications_Name" show-overflow-tooltip label="规格名称"></el-table-column>
//         <el-table-column prop="Picture_URL" width="140" align="center" label="规格图片">
//             <template v-slot="{row}">
//                 <el-image fit="contain" :preview-src-list="[BASE_IMG + row.Picture_URL]" :src="BASE_IMG + row.Picture_URL" style="width:100px;height: 100px;"></el-image>
//             </template>
//         </el-table-column>
//         <el-table-column align="center" prop="Unit_Price" show-overflow-tooltip label="吊牌价"></el-table-column>
//         <el-table-column align="center" prop="JDCOM_URL" show-overflow-tooltip label="京东连接"></el-table-column>
//         <el-table-column align="center" prop="JDCOM_Unit_Price" show-overflow-tooltip label="京东价"></el-table-column>
//         <el-table-column align="center" prop="SKU_Quantity" show-overflow-tooltip label="SKU数量"></el-table-column>
//     </el-table>
//     <el-pagination style="margin-top: 5px;" background @size-change="handleSizeChange"
//         @current-change="handleCurrentChange" :current-page="form.page" :page-sizes="[10, 20, 30, 50]"
//         :page-size="form.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
//     </el-pagination>
//     <span slot="footer" class="dialog-footer">
//         <el-button @click="$emit('update:visible',false)">返回</el-button>
//     </span></el-dialog>`,
//     props: ['id', 'visible'],
//     data() {
//         return {
//             visibleDialog: false,
//             refreshDialog: false,
//             tableData: [],
//             form: {
//                 SQLSerialNumber: "P_business_article_specifications",
//                 PaginationNumber: 1,
//                 RowAmount: 10,
//                 ExtensionCondition: '',
//                 Condition: ''
//             },
//             total: 0,
//         }
//     },
//     watch: {
//         visible() {
//             this.visibleDialog = this.visible
//         },
//         visibleDialog(val) {
//             this.$emit('update:visible', val)
//             if (val) {
//                 this.form.Condition = window.btoa(unescape(encodeURIComponent(this.id)));
//                 this.getList(this.form)
//             }
//         },
//     },
//     methods: {
//         handleSizeChange(val) {
//             this.form.PaginationNumber = 1;
//             this.form.RowAmount = val;
//             this.getList(this.form)
//         },
//         handleCurrentChange(val) {
//             this.form.PaginationNumber = val;
//             this.getList(this.form)
//         },
//         getList(data) {
//             const that = this
//             $.ajax({
//                 headers: requestHeaders(),
//                 url: `${BASE_URL2}/generalBusiness/generalPaginationQueryBySQLSerialNumber`,
//                 type: 'POST',
//                 data,
//                 success: function (Result) {
//                     that.tableData = Result.Rows;
//                     that.total = Result.TotalRows;
//                 },
//                 complete: function (XMLHttpRequest) {
//                     that.refreshDialog = false;
//                     requestPretreatment(XMLHttpRequest);
//                 },
//                 dataType: "json"
//             });
//         }
//     }
// })
Vue.component('show-detail', {
    template: `<el-dialog id="user" title="明细查询" :visible.sync="visibleDialog" width="80vw">
    <div style="display:flex;">
        <div style="width:170px;height:170px;border:1px solid #EBEEF5;flex-shrink:0;display: flex;justify-content: center; align-items: center;">
            <el-image style="width:150px;height:150px;" :preview-src-list="[BASE_IMG + data.Picture_URL]" :src="BASE_IMG + data.Picture_URL">
                <div slot="error" class="el-image__error">暂无商品封面</div>
            </el-image>
        </div>
        <el-descriptions style="width:100%" :column="3" border size="small">
            <el-descriptions-item label="商品名称">
                <el-tooltip class="item" effect="dark" :content="data.Article_Name" placement="top-start">
                    <el-input :value="data.Article_Name" :disabled="true"></el-input>
                </el-tooltip>
            </el-descriptions-item>
            <el-descriptions-item label="商品内码">
                <el-tooltip class="item" effect="dark" :content="data.Article_SerialNumber" placement="top-start">
                    <el-input :value="data.Article_SerialNumber" :disabled="true"></el-input>
                </el-tooltip>
            </el-descriptions-item>
            <el-descriptions-item label="商品编码">
                <el-tooltip class="item" effect="dark" :content="data.Article_Code" placement="top-start">
                    <el-input :value="data.Article_Code" :disabled="true"></el-input>
                </el-tooltip>
            </el-descriptions-item>
            <el-descriptions-item label="商品品牌">
                <el-tooltip class="item" effect="dark" :content="data.Brand_Name" placement="top-start">
                    <el-input :value="data.Brand_Name" :disabled="true"></el-input>
                </el-tooltip>
            </el-descriptions-item>
            <!--<el-descriptions-item label="吊牌价">
                <el-tooltip class="item" effect="dark" :content="data.Unit_Price" placement="top-start">
                    <el-input :value="data.Unit_Price" :disabled="true"></el-input>
                </el-tooltip>
            </el-descriptions-item>-->
            <el-descriptions-item label="经营商家">
                <el-tooltip class="item" effect="dark" :content="data.Supplier_Name" placement="top-start">
                    <el-input :value="data.Supplier_Name" :disabled="true"></el-input>
                </el-tooltip>
            </el-descriptions-item>
            <el-descriptions-item label="是否参与团购">
                <el-tooltip class="item" effect="dark" :content="data.Group" placement="top-start">
                    <el-input :value="data.Group" :disabled="true"></el-input>
                </el-tooltip>
            </el-descriptions-item>
            <el-descriptions-item label="京东价">
                <el-tooltip class="item" effect="dark" :content="data.JDCOM_Unit_Price" placement="top-start">
                    <el-input :value="data.JDCOM_Unit_Price" :disabled="true"></el-input>
                </el-tooltip>    
            </el-descriptions-item>
            <el-descriptions-item label="京东链接">
                <el-tooltip class="item" effect="dark" :content="data.JDCOM_URL" placement="top-start">
                    <el-input :value="data.JDCOM_URL" :disabled="true"></el-input>
                </el-tooltip> 
            </el-descriptions-item>
        </el-descriptions>
    </div>
    <div class="table_titel">
        <div class="titel">规格详情</div>
    </div>
    <el-table :data="tableData" stripe border min-height="50vh" style="width: 100%">
        <el-table-column align="center" type="index" label="序号" width="50"></el-table-column>
        <el-table-column align="center" prop="Article_Specifications_SerialNumber" width="200" show-overflow-tooltip label="规格流水号"></el-table-column>
        <el-table-column align="center" prop="BarCode" show-overflow-tooltip label="条码"></el-table-column>
        <el-table-column align="center" prop="Specifications_Name" show-overflow-tooltip label="规格名称"></el-table-column>
        <el-table-column prop="Picture_URL" width="140" align="center" label="规格图片">
            <template v-slot="{row}">
                <el-image fit="contain" :preview-src-list="[BASE_IMG + row.Picture_URL]" :src="BASE_IMG + row.Picture_URL" style="width:100px;height: 100px;"></el-image>
            </template>
        </el-table-column>
        <el-table-column align="center" prop="Unit_Price" show-overflow-tooltip label="吊牌价"></el-table-column>
        <el-table-column align="center" prop="JDCOM_URL" show-overflow-tooltip label="京东连接"></el-table-column>
        <el-table-column align="center" prop="JDCOM_Unit_Price" show-overflow-tooltip label="京东价"></el-table-column>
        <el-table-column align="center" prop="Supplier_Name" show-overflow-tooltip label="供应商"></el-table-column>
        <el-table-column align="center" prop="Sales_Unit_Price" show-overflow-tooltip label="销售价格"></el-table-column>
        <el-table-column align="center" prop="Purchase_Unit_Price" show-overflow-tooltip label="一代代发价"></el-table-column>
        <el-table-column align="center" prop="Stock_Remain" show-overflow-tooltip label="今日库存"></el-table-column>
        <el-table-column align="center" prop="Activity_Name" show-overflow-tooltip label="所属活动"></el-table-column>
        <el-table-column align="center" prop="Activity_Unit_Price" show-overflow-tooltip label="活动价格"></el-table-column>
    </el-table>
    <el-pagination style="margin-top: 5px;" background @size-change="handleSizeChange"
        @current-change="handleCurrentChange" :current-page="form.page" :page-sizes="[10, 20, 30, 50]"
        :page-size="form.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
    </el-pagination>
    <div class="table_titel">
        <div class="titel">主图/详情图</div>
    </div>
    <div style="display:flex;">
        <el-carousel v-if="Swiper.length>0" height="400px" style="width:400px;flex-shrink: 0;" indicator-position="none">
            <el-carousel-item v-for="(item,index) in Swiper" :key="index" >
                <el-image style="width:400px;height:400px;" :preview-src-list="[BASE_IMG + item.Picture_URL]" :src="BASE_IMG + item.Picture_URL">
                    <div slot="error" class="el-image__error">加载失败</div>
                </el-image>
            </el-carousel-item>
        </el-carousel>
        <div v-if="Detail.length>0" style="width:100%; height:400px;display:flex;justify-content: center; overflow-y: auto;">
            <div style="width:400px">
                <el-image v-for="(item,index) in Detail" :key="index" style="width:400px;" fit="contain" :preview-src-list="[BASE_IMG + item.Picture_URL]" :src="BASE_IMG + item.Picture_URL">
                    <div slot="error" class="el-image__error">加载失败</div>
                </el-image>
            </div>
        </div>
    </div>
    <span slot="footer" class="dialog-footer">
        <el-button @click="$emit('update:visible',false)">返回</el-button>
    </span></el-dialog>`,
    props: ['data', 'visible'],
    data() {
        return {
            visibleDialog: false,
            refreshDialog: false,
            Picture_URL: [],
            tableData: [],
            form: {
                SQLSerialNumber: "P_business_article_specifications",
                PaginationNumber: 1,
                RowAmount: 10,
                ExtensionCondition: '',
                Condition: ''
            },
            total: 0,
        }
    },
    computed: {
        Swiper() {//冒泡排序处理轮播图		
            let Picture_URL = this.Picture_URL.filter(i => i.Picture_Type == '0')
            for (var i = 0; i < Picture_URL.length - 1; i++) {
                for (var j = 0; j < Picture_URL.length - i - 1; j++) {
                    if (parseInt(Picture_URL[j].Picture_Order) > parseInt(Picture_URL[j + 1].Picture_Order)) {
                        var count = Picture_URL[j];
                        Picture_URL[j] = Picture_URL[j + 1];
                        Picture_URL[j + 1] = count;
                    };
                };
            };
            return Picture_URL
        },
        Detail() {//冒泡排序处理详情图
            let Picture_URL = this.Picture_URL.filter(i => i.Picture_Type == '1')
            for (var i = 0; i < Picture_URL.length - 1; i++) {
                for (var j = 0; j < Picture_URL.length - i - 1; j++) {
                    if (parseInt(Picture_URL[j].Picture_Order) > parseInt(Picture_URL[j + 1].Picture_Order)) {
                        var count = Picture_URL[j];
                        Picture_URL[j] = Picture_URL[j + 1];
                        Picture_URL[j + 1] = count;
                    };
                };
            };
            return Picture_URL
        },
    },
    watch: {
        visible() {
            this.visibleDialog = this.visible
        },
        visibleDialog(val) {
            this.$emit('update:visible', val)
            if (val) {
                this.form.Condition = window.btoa(unescape(encodeURIComponent(this.data.Article_SerialNumber)));
                this.getList(this.form);
                this.getData()
            }
        },
    },
    methods: {
        handleSizeChange(val) {
            this.form.PaginationNumber = 1;
            this.form.RowAmount = val;
            this.getList(this.form)
        },
        handleCurrentChange(val) {
            this.form.PaginationNumber = val;
            this.getList(this.form)
        },
        expandChange(row) {
            $.ajax({
                headers: requestHeaders(),
                url: `${BASE_URL2}/generalBusiness/generalQueryBySQLSerialNumber`,
                type: 'POST',
                data: {
                    SQLSerialNumber: "A_business_supplier_article1",
                    Condition: window.btoa(unescape(encodeURIComponent(row.Article_Specifications_SerialNumber))),
                    ExtensionCondition: '',
                },
                success: function (Result) {
                    row.Children = Result
                },
                complete: function (XMLHttpRequest) {
                    requestPretreatment(XMLHttpRequest);
                },
                dataType: "json"
            });
        },
        getList(data) {
            const that = this
            $.ajax({
                headers: requestHeaders(),
                url: `${BASE_URL2}/generalBusiness/generalPaginationQueryBySQLSerialNumber`,
                type: 'POST',
                data,
                success: function (Result) {
                    // Result.Rows.forEach(item=>{
                    //     item['Children'] = []
                    // })
                    that.tableData = Result.Rows;
                    console.log(Result.Rows);
                    that.total = Result.TotalRows;
                },
                complete: function (XMLHttpRequest) {
                    that.refreshDialog = false;
                    requestPretreatment(XMLHttpRequest);
                },
                dataType: "json"
            });
        },
        getData() {
            const that = this;
            $.ajax({
                headers: requestHeaders(),
                url: `${BASE_URL2}/generalBusiness/generalQueryByTableName`,
                type: 'GET',
                data: {
                    Data: 'business_article_pic',
                    Condition: "Article_SerialNumber = '" + this.data.Article_SerialNumber + "'",
                },
                success: function (Result) {
                    that.Picture_URL = Result;
                },
                complete: function (XMLHttpRequest) {
                    that.refreshDialog = false;
                    requestPretreatment(XMLHttpRequest);
                },
                dataType: "json"
            });
        }
    }
})
Vue.component('batch-review', {
    template: `<el-dialog id="batch" title="批量审核" :visible.sync="visibleDialog" width="80vw">
    <el-form :inline="true" :form="form">
        <el-form-item>
            <el-row style="width:310px;">
                <el-col :span="24" style="display: flex; justify-content: space-between;align-items: center;">
                    <el-radio size="mini" v-model="radio" label="1">按毛利率设置平台价</el-radio>
                    <el-input type="number" :disabled="radio!='1'" size="small" style="width:150px" v-model="input1" placeholder="请输入毛利率%">
                        <template slot="append">%</template>
                    </el-input>
                </el-col>
                <el-col :span="24" style="margin-top:10px;  display: flex; justify-content: space-between;align-items: center;">
                    <el-radio size="mini" v-model="radio" label="2">按折扣设置平台价</el-radio>
                    <el-input type="number" :disabled="radio!='2'" size="small" style="width:150px" v-model="input2" placeholder="请输入折扣%">
                        <template slot="append">%</template>
                    </el-input>
                </el-col>
            </el-row>
        </el-form-item>
        <!-- <el-form-item>
            <el-row style="width: 380px;">
                <el-col :span="11">
                    <el-date-picker style="width:100%" v-model.trim="sales_unitprice.Start_Date" type="date" placeholder="平台价开始时间"
                        value-format="yyyy-MM-dd"></el-date-picker>
                </el-col>
                <el-col style="text-align: center;" :span="2">-</el-col>
                <el-col :span="11">
                    <el-date-picker style="width:100%" v-model.trim="sales_unitprice.End_Date" type="date" placeholder="平台价结束时间"
                        value-format="yyyy-MM-dd"></el-date-picker>
                </el-col>
            </el-row>
        </el-form-item> -->
    </el-form>
    <el-table :data="tableData" stripe border height="40vh" style="width: 100%" :cell-style="tableCellStyle">
        <el-table-column align="center" type="index" label="序号" width="50"></el-table-column>
        <el-table-column prop="Article_SerialNumber" label="商品内码"></el-table-column>
        <el-table-column prop="Article_SerialNumber" align="center" width="140" label="商品封面">
            <template v-slot="{row}">
                <el-image fit="contain" :preview-src-list="[BASE_IMG + row.Picture_URL]"
                    :src="BASE_IMG + row.Picture_URL" style="width:100px;height: 100px;"></el-image>
            </template>
        </el-table-column>
        <el-table-column prop="Article_Name" width="140" label="商品名称"></el-table-column>
        <el-table-column prop="Specifications_Name" width="150" label="规格名称"></el-table-column>
        <el-table-column prop="Brand_Name" label="品牌"></el-table-column>
        <el-table-column prop="Classify_Name" label="商品分类"></el-table-column>
        <el-table-column prop="Supplier_Name" label="供应商"></el-table-column>
        <el-table-column prop="JDCOM_URL1" width="120" label="规格京东链接"></el-table-column>
        <el-table-column prop="JDCOM_Unit_Price1" width="120" label="规格京东价(元)"></el-table-column>
        <el-table-column prop="Group" width="120" label="是否参与团购"></el-table-column>
        <el-table-column prop="Purchase_Unit_Price" width="120" label="一键代发价(元)"></el-table-column>
        <el-table-column  width="140" label="平台价(元)">
            <template v-slot="{row}">
                <el-input type="number" size="mini" style="width:110px" v-model="row.Sales_Unit_Price" placeholder="请输入平台价"></el-input>
            </template>
        </el-table-column>
        <el-table-column label="折扣率">
            <template v-slot="{row}">
                {{row.JDCOM_Unit_Price1!=''&&row.Sales_Unit_Price!=''?(accDiv(row.Sales_Unit_Price,row.JDCOM_Unit_Price1)*100).toFixed(2) + '%':'-'}}
            </template>
        </el-table-column>
        <el-table-column label="毛利率">
            <template v-slot="{row}">
                {{row.Purchase_Unit_Price!=''&&row.Sales_Unit_Price!=''?(accSub(1,accDiv(row.Purchase_Unit_Price,row.Sales_Unit_Price))*100).toFixed(2)+'%':'-'}}
            </template>
        </el-table-column>
    </el-table>
    <el-pagination style="margin-top: 5px;" background @size-change="handleSizeChange"
        @current-change="handleCurrentChange" :current-page="form.page" :page-sizes="[5 ,10, 20, 30, 50]"
        :page-size="form.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
    </el-pagination>
    <span slot="footer" class="dialog-footer">
        <el-button @click="$emit('update:visible',false)">返回</el-button>
        <el-button type="success" @click="examine">审核通过</el-button>
        <!-- <el-button type="danger" @click="refuse">审核拒绝</el-button> -->
    </span></el-dialog>`,
    props: ['data', 'visible'],
    data() {
        return {
            radio: '1',
            input1: '',
            input2: '',
            visibleDialog: false,
            tableData: [],
            form: {
                page: 1,
                limit: 10,
            },
            total: 0,
            sales_unitprice: {
                Start_Date: getYMDDate(),
                End_Date: '',
                Children: {
                    business_sales_unitprice_detail: []
                }
            }
        }
    },
    watch: {
        visible() {
            this.visibleDialog = this.visible
        },
        visibleDialog(val) {
            this.$emit('update:visible', val)
        },
        data(val) {
            this.tableData = val;
        },
        input1(val) {//根据毛利率设置平台价
            if (this.radio == '1') {
                this.tableData.forEach(item => {
                    item.Sales_Unit_Price = Math.ceil(accDiv(item.Purchase_Unit_Price, accSub(1, val / 100).toFixed(2)));
                })
            }
        },
        input2(val) {
            if (this.radio == '2') {
                this.tableData.forEach(item => {
                    item.Sales_Unit_Price = Math.ceil(accMul(item.JDCOM_Unit_Price1, val / 100));
                })
            }
        },
        radio(val) {
            if (val == '2') {
                this.input1 = '';
            } else {
                this.input2 = '';
            }
            this.tableData.forEach(item => {
                item.Sales_Unit_Price = '';
            })
        }
    },
    methods: {
        handleSizeChange(val) {
            this.form.page = 1;
            this.form.limit = val;
        },
        handleCurrentChange(val) {
            this.form.page = val;
        },
        tableCellStyle({ row, column, rowIndex, columnIndex }) {
            let val = accSub(1, accDiv(row.Purchase_Unit_Price, row.Sales_Unit_Price)) * 100;
            if (row.Purchase_Unit_Price != '' && row.Sales_Unit_Price != '' && val < 0) return { color: 'red' }
        },
        examine() {
            const that = this;
            let Condition1 = "", Condition2 = "",business_article_log = [];
            this.tableData.forEach(item=>{
                business_article_log.push({
                    Article_SerialNumber: item.Article_SerialNumber,
                    Supplier_Article_SerialNumber: item.Supplier_Article_SerialNumber.includes('-')?item.Supplier_Article_SerialNumber:'',
                    Create_ID: item.Operation_ID,
                    Purchase_Unit_Price:item.Purchase_Unit_Price,
                    Row_Status: '0'
                })
            })
            this.tableData.filter(i => i.Row_Status == '9'||i.Row_Status == '8').forEach(item => {
                if (Condition1) {
                    Condition1 = Condition1 + " OR Article_SerialNumber='" + item.Article_SerialNumber + "'";
                } else {
                    Condition1 = "Article_SerialNumber='" + item.Article_SerialNumber + "'"
                }
            });
            let business_sales_unitprice_detail1 = []
            this.tableData.filter(i => i.Supplier_Article_SerialNumber.includes('-') && i.Sales_Unit_Price).forEach(item => {
                if (Condition2) {
                    Condition2 = Condition2 + " OR Supplier_Article_SerialNumber='" + item.Supplier_Article_SerialNumber + "'";
                } else {
                    Condition2 = "Supplier_Article_SerialNumber='" + item.Supplier_Article_SerialNumber + "'"
                }
                business_sales_unitprice_detail1.push({
                    Sales_Unit_Price_Detail_SerialNumber: '',
                    Sales_Unit_Price_SerialNumber: '',
                    Supplier_Article_SerialNumber: item.Supplier_Article_SerialNumber,
                    Brand_SerialNumber: item.Brand_SerialNumber,
                    Supplier_SerialNumber: item.Supplier_SerialNumber,
                    Unit_Price: item.Sales_Unit_Price,
                })
            })
            this.sales_unitprice['Children'] = {
                business_sales_unitprice_detail:business_sales_unitprice_detail1,
                business_sales_unitprice_storescope:[{
                    Store_SerialNumber:'STORE0000000001'
                }]
            }
            let business_sales_unitprice = [this.sales_unitprice]
            $.ajax({
                headers: requestHeaders(),
                url: `${BASE_URL2}/member/getMemberPoint`,
                type: 'POST',
                data: {
                    Data: JSON.stringify([{
                        tableName: 'business_article_info',
                        Condition: window.btoa(unescape(encodeURIComponent(Condition1 ? Condition1 : "Row_Status='-'"))),
                    }, {
                        tableName: 'business_purchase_unitprice_detail',
                        Condition: window.btoa(unescape(encodeURIComponent(Condition2 ? "(" + Condition2 + ") AND Row_Status='2'" : "Row_Status='-'"))),
                    }, {
                        tableName: 'business_supplier_article',
                        Condition: window.btoa(unescape(encodeURIComponent(Condition2 ? Condition2 : "Row_Status='-'"))),
                    }, {
                        tableName: 'business_daily_execute_unitprice',
                        Condition: window.btoa(unescape(encodeURIComponent(Condition2 ?"(" +  Condition2 + ") AND Execute_Date = DATE(NOW())" : "Row_Status='-'"))),
                    }, {
                        tableName: 'business_sales_unitprice_detail',
                        Condition: window.btoa(unescape(encodeURIComponent(Condition2 ?"(" + Condition2 + ") AND Row_Status = '0'" : "Row_Status='-'"))),
                    }, {
                        tableName: 'business_daily_execute_stock',
                        Condition: window.btoa(unescape(encodeURIComponent(Condition2 ?"(" +  Condition2 + ") AND Execute_Date = DATE(NOW())" : "Row_Status='-'"))),
                    }])
                },
                success: function ({ business_article_info, business_purchase_unitprice_detail, business_supplier_article,business_daily_execute_unitprice,business_sales_unitprice_detail,business_daily_execute_stock }) {
                    business_article_info.forEach(item => {
                        item.Row_Status = '0';
                    });
                    business_purchase_unitprice_detail.forEach(item => {
                        item.Row_Status = '0';
                    })
                    business_supplier_article.forEach(item => {
                        item.Row_Status = '0';
                    })
                    business_daily_execute_unitprice.forEach(item=>{
                        item.Row_Status = '0';
                        item.Sales_Unit_Price = business_sales_unitprice_detail1.filter(i=>i.Supplier_Article_SerialNumber == item.Supplier_Article_SerialNumber)[0].Unit_Price
                    })
                    business_sales_unitprice_detail.forEach(item=>{
                        item.Row_Status = '1';
                    })
                    business_daily_execute_stock.forEach(item=>{
                        item.Row_Status = '0';
                    })
                    console.log(JSON.stringify({
                        Modify: {
                            business_article_info, business_purchase_unitprice_detail, business_supplier_article,business_sales_unitprice_detail,business_daily_execute_unitprice,business_daily_execute_stock
                        },
                        Add: {
                            business_sales_unitprice,business_article_log
                        }
                    }));
                    $.ajax({
                        headers: requestHeaders(),
                        type: 'POST',
                        url: `${BASE_URL2}/generalBusiness/generalSave`,
                        data: {
                            Data: JSON.stringify({
                                Modify: {
                                    business_article_info, business_purchase_unitprice_detail, business_supplier_article,business_sales_unitprice_detail,business_daily_execute_unitprice,business_daily_execute_stock
                                },
                                Add: {
                                    business_sales_unitprice,business_article_log
                                }
                            })
                        },
                        success: function (Result) {
                            if (Result.Status == 'success') {
                                that.$message({
                                    type: 'success',
                                    message: '审核成功'
                                });
                                that.$emit('success');
                                $.ajax({//更新今日执行单
                                    headers: requestHeaders(),
                                    url: `${BASE_URL2}/article/generateDailyInventory`,
                                    type: 'GET',
                                    complete: function (XMLHttpRequest) {
                                    }
                                })
                                $.ajax({//更新今日执行单
                                    headers: requestHeaders(),
                                    url: `${BASE_URL2}/article/generateDailyArticleSalesPrice`,
                                    type: 'GET',
                                    complete: function (XMLHttpRequest) {
                                    }
                                })
                                $.ajax({//更新今日执行单
                                    headers: requestHeaders(),
                                    url: `${BASE_URL2}/article/generateDailyArticlePurchasePrice`,
                                    type: 'GET',
                                    complete: function (XMLHttpRequest) {
                                    }
                                })
                            } else {
                                that.$message.error("系统繁忙，请重试")
                            }
                        },
                        complete: function (XMLHttpRequest) {
                            that.$emit('update:visible', false);
                            that.loading = false;
                            requestPretreatment(XMLHttpRequest);
                        },
                        dataType: "json"
                    });
                },
                complete: function (XMLHttpRequest) {
                    requestPretreatment(XMLHttpRequest);
                },
                dataType: "json"
            });
        },
        refuse() {//拒绝

        }
    }
})
new Vue({
    el: '#app',
    data() {
        return {
            form: {
                // SQLSerialNumber: "P_business_article_info1",
                SQLSerialNumber: 'P_examine_article',
                PaginationNumber: 1,//页数
                RowAmount: 10,//每页数据条数
                Condition: '',
                ExtensionCondition: '',
                Article_Name: '',
                Supplier_Name: '',
                Brand_SerialNumber: '',
                Purchase_Unit_Price2:'',
                Purchase_Unit_Price1:'',
                Article_SerialNumber:''
            },
            total: 0,
            tableData: [],	//表格数据
            ExportData: [],
            multipleSelection: [],
            brand: [], //商品品牌
            loading: false,
            dialogVisible: false,
            dialogVisible1: false,
            Article_SerialNumber: {},
            business_article_classify:[],
            classify:[],
            supplier:[],
            defaultProps: {
                children: 'Children',
                label: 'Classify_Name',
                value: 'Classify_SerialNumber',
                multiple:true
            },
            table:true
        }
    },
    mounted() {
        this.getData();
        this.getList(this.form);//前端分页
    },
    methods: {
        success() {
            this.$refs.multipleTable.clearSelection();
            this.getList(this.form);
        },
        getData() {
            const that = this;
            const Condition = "Row_Status='0'";
            // $.ajax({
            //     headers: requestHeaders(),
            //     url: `${BASE_URL2}/generalBusiness/generalQueryByTableName`,
            //     type: 'POST',
            //     data: {
            //         Data: 'business_brand',
            //         Condition,
            //     },
            //     success: function (res) {
            //         that.brand = res;
            //     },
            //     error: function () {
            //         that.$message.error("操作失败，请稍后再试")
            //     },
            //     complete: function (XMLHttpRequest) {
            //         that.loading = false
            //         requestPretreatment(XMLHttpRequest);
            //     },
            //     dataType: "json"
            // });
            $.ajax({
                headers: requestHeaders1(),
                url: `${BASE_URL1}/queryClassifyAction`,
                type: 'GET',
                success: function (res) {
                    if (res.Status == 'success') {
                        that.classify = res.Data
                    }
                },
                dataType: "json"
            });
            $.ajax({
                headers: requestHeaders(),
                url: `${BASE_URL2}/generalBusiness/generalQueryBySQLSerialNumber`,
                type: 'POST',
                data: {
                    SQLSerialNumber: 'A_examine_supplier_info',
                    Condition: '',
                    ExtensionCondition: '',
                },
                success: function (res) {
                    that.supplier = res
                },
                error: function () {
                    that.$message.error("操作失败，请稍后再试")
                },
                complete: function (XMLHttpRequest) {
                    that.loading = false
                    requestPretreatment(XMLHttpRequest);
                },
                dataType: "json"
            });
            $.ajax({
                headers: requestHeaders(),
                url: `${BASE_URL2}/generalBusiness/generalQueryBySQLSerialNumber`,
                type: 'POST',
                data: {
                    SQLSerialNumber: 'A_examine_business_brand',
                    Condition: '',
                    ExtensionCondition: '',
                },
                success: function (res) {
                    that.brand = res
                },
                error: function () {
                    that.$message.error("操作失败，请稍后再试")
                },
                complete: function (XMLHttpRequest) {
                    that.loading = false
                    requestPretreatment(XMLHttpRequest);
                },
                dataType: "json"
            })
        },
        onSerach() {			//查询方法
            this.form.PaginationNumber = 1;
            this.getList(this.form)
        },
        examine(command, row) {//审核
            const that = this;
            if (command == 'true') {
                this.$confirm('确认审核通过，是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning',
                }).then(() => {
                    row.Row_Status = '0'
                    let business_article_log = [{
                        Article_SerialNumber: row.Article_SerialNumber,
                        Create_ID: row.Operation_ID,
                        Row_Status: '0'
                    }]
                    $.ajax({
                        headers: requestHeaders(),
                        url: `${BASE_URL2}/generalBusiness/generalSave`,
                        type: 'POST',
                        data: {
                            Data: JSON.stringify({ Modify: { business_article_info: [row] }, Add: { business_article_log } })
                        },
                        success: function (res) {
                            if (res.Status === 'success') {
                                that.$message({
                                    type: 'success',
                                    message: '审核通过!'
                                });
                                that.getList(that.form);
                            } else {
                                that.$message.error("操作失败")
                            }
                        },
                        error: function () {
                            that.$message.error("系统繁忙")
                        },
                        complete: function (XMLHttpRequest) {
                            that.loading = false
                            requestPretreatment(XMLHttpRequest);
                        },
                        dataType: "json"
                    })
                }).catch(() => { });
            } else if (command == 'false') {
                this.$prompt('确认审核未通过，并填写拒绝原因?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning',
                }).then(({ value }) => {
                    row.Row_Status = '8'
                    row.Article_Name = row.Article_Name;
                    let business_article_log = [{
                        Article_SerialNumber: row.Article_SerialNumber,
                        Create_ID: row.Operation_ID,
                        Casue: value ? value : '',
                        Row_Status: '1'
                    }]
                    $.ajax({
                        headers: requestHeaders(),
                        url: `${BASE_URL2}/generalBusiness/generalSave`,
                        type: 'POST',
                        data: {
                            Data: JSON.stringify({ Modify: { business_article_info: [row] }, Add: { business_article_log } })
                        },
                        success: function (res) {
                            if (res.Status === 'success') {
                                that.$message({
                                    type: 'success',
                                    message: '已拒绝!'
                                });
                                that.getList(that.form);
                            } else {
                                that.$message.error("操作失败")
                            }
                        },
                        error: function () {
                            that.$message.error("系统繁忙")
                        },
                        complete: function (XMLHttpRequest) {
                            that.loading = false
                            requestPretreatment(XMLHttpRequest);
                        },
                        dataType: "json"
                    })
                }).catch(() => { });
            } else if (command == 'Edit') {
                sessionStorage.setItem("Article_SerialNumber", row.Article_SerialNumber)
                window.location.href = './edit.html?Article_SerialNumber=' + row.Article_SerialNumber
            }
        },
        batchConfig1() {
            if (this.multipleSelection.length > 0) {
                this.dialogVisible1 = true
            } else {
                this.$message({
                    type: 'warning',
                    message: '请选择要审核的商品!'
                })
            }
        },
        batchConfig(command) {
            if (command == 'true') {
                this.batchConfig1();
            } else if (command == 'false') {
                this.$prompt('确认审核未通过，并填写拒绝原因?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(({ value }) => {
                    const that = this;
                    let Condition1 = "", Condition2 = "",Condition3 = "",business_article_log=[];
                    this.multipleSelection.forEach(item=>{
                        business_article_log.push({
                            Article_SerialNumber: item.Article_SerialNumber,
                            Supplier_Article_SerialNumber: item.Supplier_Article_SerialNumber.includes('-')?item.Supplier_Article_SerialNumber:'',
                            Create_ID: item.Operation_ID,
                            Casue: value ? value : '',
                            Row_Status: '1'
                        })
                    })
                    this.multipleSelection.filter(i => i.Row_Status == '9'||i.Row_Status == '8').forEach(item => {
                        if (Condition1) {
                            Condition1 = Condition1 + " OR Article_SerialNumber='" + item.Article_SerialNumber + "'";
                            Condition3 = Condition3 + ` OR base_operation_log.Operation_Main LIKE '{"Modify":{"business_article_info":[{"Article_SerialNumber":"${ item.Article_SerialNumber}"%'`
                        } else {
                            Condition1 = "Article_SerialNumber='" + item.Article_SerialNumber + "'"
                            Condition3 = `WHERE base_operation_log.Operation_Main LIKE '{"Modify":{"business_article_info":[{"Article_SerialNumber":"${ item.Article_SerialNumber}"%'`
                        }
                    });
                    this.multipleSelection.filter(i => i.Supplier_Article_SerialNumber.includes('-')).forEach(item => {
                        if (Condition2) {
                            Condition2 = Condition2 + " OR Supplier_Article_SerialNumber='" + item.Supplier_Article_SerialNumber + "'";
                        } else {
                            Condition2 = "Supplier_Article_SerialNumber='" + item.Supplier_Article_SerialNumber + "'"
                        }
                    })
                    $.ajax({
                        headers: requestHeaders(),
                        url: `${BASE_URL2}/generalBusiness/generalQueryBySQLSerialNumber`,
                        type: 'POST',
                        data: {
                            SQLSerialNumber: 'P_base_operation_log_A',
                            Condition: '',
                            ExtensionCondition: window.btoa(unescape(encodeURIComponent(Condition3?Condition3:"WHERE Row_Status='-'"))),
                        },
                        success: function (data) {
                            $.ajax({
                                headers: requestHeaders(),
                                url: `${BASE_URL2}/member/getMemberPoint`,
                                type: 'POST',
                                data: {
                                    Data: JSON.stringify([{
                                        tableName: 'business_article_info',
                                        Condition: window.btoa(unescape(encodeURIComponent(Condition1 ? Condition1 : "Row_Status='-'"))),
                                    },{
                                        tableName: 'business_article_specifications',
                                        Condition: window.btoa(unescape(encodeURIComponent(Condition1 ? Condition1 : "Row_Status='-'"))),
                                    }, {
                                        tableName: 'business_purchase_unitprice_detail',
                                        Condition: window.btoa(unescape(encodeURIComponent(Condition2 ? "(" + Condition2 + ") AND Row_Status='2'" : "Row_Status='-'"))),
                                    }, {
                                        tableName: 'business_supplier_article',
                                        Condition: window.btoa(unescape(encodeURIComponent(Condition2 ? Condition2 : "Row_Status='-'"))),
                                    }, {
                                        tableName: 'business_supplier_article_stock_detail',
                                        Condition: window.btoa(unescape(encodeURIComponent(Condition2 ? "(" + Condition2 + ") AND Row_Status='0'": "Row_Status='-'"))),
                                    }])
                                },
                                success: function ({ business_article_info, business_article_specifications, business_purchase_unitprice_detail, business_supplier_article,business_supplier_article_stock_detail }) {
                                    business_article_info.filter(i=>i.Row_Status == '9').forEach(item => {
                                        let obj = data.filter(i=>i.Operation_Main.includes('{"Modify":{"business_article_info":[{"Article_SerialNumber":"'+item.Article_SerialNumber+'"'))[0]
                                        if (obj) {
                                            let old_article_info = JSON.parse(obj.Operation_Main).Modify.business_article_info[0];
                                            item.Article_Name = old_article_info.Article_Name_Original;
                                            item.Brand_SerialNumber = old_article_info.Brand_SerialNumber_Original;
                                            item.JDCOM_Unit_Price = old_article_info.JDCOM_Unit_Price_Original;
                                            item.JDCOM_URL = old_article_info.JDCOM_URL_Original;
                                            item.Group = old_article_info.Group_Original;
                                            item.Picture_URL = old_article_info.Picture_URL_Original;

                                            //获取规格
                                            let old_business_article_specifications = old_article_info.Children.business_article_specifications;
                                            let Modify_business_article_specifications = business_article_specifications.filter(i=>i.Article_SerialNumber == item.Article_SerialNumber);
                                            Modify_business_article_specifications.forEach(obj=>{
                                                let obj1 = old_business_article_specifications.filter(j=>j.Article_Specifications_SerialNumber = obj.Article_Specifications_SerialNumber)[0];
                                                obj.Picture_URL = obj1.Picture_URL_Original;
                                                obj.Staples_Code = obj1.Staples_Code_Original;
                                                obj.Staples_Code1 = obj1.Staples_Code1_Original;
                                                obj.Unit_Price = obj1.Unit_Price_Original;
                                                obj.Centralize_Purchase_Price = obj1.Centralize_Purchase_Price_Original;
                                                obj.JDCOM_Unit_Price = obj1.JDCOM_Unit_Price_Original;
                                                obj.JDCOM_URL = obj1.JDCOM_URL_Original;
                                                obj.SKU_Quantity = obj1.SKU_Quantity_Original;
                                                obj.Weight = obj1.Weight_Original;
                                                obj.Weight_Unit = obj1.Weight_Unit_Original;
                                            })
                                            
                                            item['Children'] = {
                                                business_article_specifications:Modify_business_article_specifications
                                            }
                                        }
                                        item.Row_Status = '8';
                                    });
                                    business_purchase_unitprice_detail.forEach(item => {
                                        item.Row_Status = '1';
                                    })
                                    business_supplier_article.forEach(item => {
                                        item.Row_Status = '88';
                                    })
                                    business_supplier_article_stock_detail.forEach(item=>{
                                        item.Row_Status = '1';
                                    })
                                    $.ajax({
                                        headers: requestHeaders(),
                                        type: 'POST',
                                        url: `${BASE_URL2}/generalBusiness/generalSave`,
                                        data: {
                                            Data: JSON.stringify({
                                                Modify: {
                                                    business_article_info, business_purchase_unitprice_detail, business_supplier_article,business_supplier_article_stock_detail
                                                },
                                                Add: {business_article_log}
                                            })
                                        },
                                        success: function (Result) {
                                            if (Result.Status == 'success') {
                                                that.$message({
                                                    type: 'success',
                                                    message: '拒绝成功'
                                                });
                                                that.success();
                                            } else {
                                                that.$message.error("系统繁忙，请重试")
                                            }
                                        },
                                        complete: function (XMLHttpRequest) {
                                            that.$emit('update:visible', false);
                                            that.loading = false;
                                            requestPretreatment(XMLHttpRequest);
                                        },
                                        dataType: "json"
                                    });
                                },
                                complete: function (XMLHttpRequest) {
                                    requestPretreatment(XMLHttpRequest);
                                },
                                dataType: "json"
                            });
                        },
                        complete: function (XMLHttpRequest) {
                            requestPretreatment(XMLHttpRequest);
                        },
                        dataType: "json"
                    })
                    
                }).catch(() => { });
            }
        },
        // batchConfig(command) {
        //     const that = this;
        //     if (this.multipleSelection.length > 0) {
        //         if (command == 'true') {
        //             this.$confirm('确认审核通过，是否继续?', '提示', {
        //                 confirmButtonText: '确定',
        //                 cancelButtonText: '取消',
        //                 type: 'warning',
        //             }).then(() => {
        //                 let business_article_log = [];
        //                 this.multipleSelection.forEach(row=>{
        //                     row.Row_Status = '0'
        //                     business_article_log.push({
        //                         Article_SerialNumber: row.Article_SerialNumber,
        //                         Create_ID:row.Operation_ID,
        //                         Row_Status: '0'
        //                     })
        //                 })
        //                 $.ajax({
        //                     headers: requestHeaders(),
        //                     url: `${BASE_URL2}/generalBusiness/generalSave`,
        //                     type: 'POST',
        //                     data: {
        //                         Data: JSON.stringify({ Modify: { business_article_info: this.multipleSelection }, Add: { business_article_log } })
        //                     },
        //                     success: function (res) {
        //                         if (res.Status === 'success') {
        //                             that.$message({
        //                                 type: 'success',
        //                                 message: '审核通过!'
        //                             });
        //                             that.getList(that.form);
        //                         } else {
        //                             that.$message.error("操作失败")
        //                         }
        //                     },
        //                     error: function () {
        //                         that.$message.error("系统繁忙")
        //                     },
        //                     complete: function (XMLHttpRequest) {
        //                         that.loading = false
        //                         requestPretreatment(XMLHttpRequest);
        //                     },
        //                     dataType: "json"
        //                 })
        //             }).catch(() => { });
        //         }else if (command == 'false'){
        //             this.$prompt('确认审核未通过，并填写拒绝原因?', '提示', {
        //                 confirmButtonText: '确定',
        //                 cancelButtonText: '取消',
        //                 type: 'warning',
        //             }).then(({ value }) => {
        //                 let business_article_log = [];
        //                 this.multipleSelection.forEach(row=>{
        //                     row.Row_Status = '8'
        //                     row.Article_Name = row.Article_Name
        //                     business_article_log.push({
        //                         Article_SerialNumber: row.Article_SerialNumber,
        //                         Create_ID:row.Operation_ID,
        //                         Casue: value?value:'',
        //                         Row_Status: '1'
        //                     })
        //                 })
        //                 $.ajax({
        //                     headers: requestHeaders(),
        //                     url: `${BASE_URL2}/generalBusiness/generalSave`,
        //                     type: 'POST',
        //                     data: {
        //                         Data: JSON.stringify({ Modify: { business_article_info: this.multipleSelection }, Add: { business_article_log } })
        //                     },
        //                     success: function (res) {
        //                         if (res.Status === 'success') {
        //                             that.$message({
        //                                 type: 'success',
        //                                 message: '已拒绝!'
        //                             });
        //                             that.getList(that.form);
        //                         } else {
        //                             that.$message.error("操作失败")
        //                         }
        //                     },
        //                     error: function () {
        //                         that.$message.error("系统繁忙")
        //                     },
        //                     complete: function (XMLHttpRequest) {
        //                         that.loading = false
        //                         requestPretreatment(XMLHttpRequest);
        //                     },
        //                     dataType: "json"
        //                 })
        //             }).catch(() => { });
        //         }
        //     }else{
        //         that.$message({
        //             message: "请选择待审核的商品",
        //             type: 'warning'
        //         })
        //     }
        // },
        Show(Article_SerialNumber) {
            this.Article_SerialNumber = Article_SerialNumber
            this.dialogVisible = true
        },
        handleSelectionChange(val) {
            this.multipleSelection = val;
        },
        handleSizeChange(val) {
            this.form.PaginationNumber = 1;
            this.form.RowAmount = val;
            this.getList(this.form)
        },
        handleCurrentChange(val) {
            this.form.PaginationNumber = val;
            this.getList(this.form)
        },
        downloadTemplate(command) {
            if (command == "Article") {
                window.location.href = './download/导入商品模板表.xlsx';
            } else if (command == "BarCode") {
                window.location.href = './download/导入条形码模板.xlsx';
            }
        },
        importTemplate(command) {
            if (command == "Article") {
                window.location.href = './import_article.html';
            } else if (command == "BarCode") {
                window.location.href = './import_barcode.html';
            }
        },
        Download0(Article_SerialNumber) {//下载主图
            const that = this;
            $.ajax({
                headers: requestHeaders(),
                type: 'POST',
                url: `${BASE_URL2}/generalBusiness/generalQueryByTableName`,
                data: {
                    Data: 'business_article_pic',
                    Condition: "Article_SerialNumber='" + Article_SerialNumber + "' and Row_Status='0' and Picture_Type='0'",
                },
                success: function (Result) {
                    let Files = "";
                    Result.forEach(item => {
                        if (Files) {
                            Files = Files + "," + item.Picture_URL;
                        } else {
                            Files = item.Picture_URL;
                        }
                    })
                    const url = `${BASE_URL2}/login/downloadZipFile?Files=${Files}`;
                    const a = document.createElement('a');
                    a.style.display = 'none';
                    a.href = url;
                    document.body.appendChild(a);
                    a.click(); // 触发点击
                    a.remove();
                },
                complete: function (XMLHttpRequest) {
                    requestPretreatment(XMLHttpRequest);
                },
                dataType: "json"
            });
        },
        Download1(Article_SerialNumber) {//下载详情图
            $.ajax({
                headers: requestHeaders(),
                type: 'POST',
                url: `${BASE_URL2}/generalBusiness/generalQueryByTableName`,
                data: {
                    Data: 'business_article_pic',
                    Condition: "Article_SerialNumber='" + Article_SerialNumber + "' and Row_Status='0' and Picture_Type='1'",
                },
                success: function (Result) {
                    let Files = "";
                    Result.forEach(item => {
                        if (Files) {
                            Files = Files + "," + item.Picture_URL;
                        } else {
                            Files = item.Picture_URL;
                        }
                    })
                    const url = `${BASE_URL2}/login/downloadZipFile?Files=${Files}`;
                    const a = document.createElement('a');
                    a.style.display = 'none';
                    a.href = url;
                    document.body.appendChild(a);
                    a.click(); // 触发点击
                    a.remove();
                },
                complete: function (XMLHttpRequest) {
                    requestPretreatment(XMLHttpRequest);
                },
                dataType: "json"
            });
        },
        downloadAddTemplate() {//新增商品模板
            window.location.href = './download/导入商品模板表.xlsx';
        },
        downloadEditTemplate() {//更新商品模板
            window.location.href = './download/更新商品信息导入模板表.xlsx';
        },
        getList(form) {//换页方法
            const that = this
            let data = deepClone(form);
            let SQL = "";
            if (data.Article_Name) {
                SQL = SQL + " and business_article_info.Article_Name LIKE '%" + data.Article_Name + "%' \r\n"
            }
            if (data.Article_SerialNumber) {
                SQL = SQL + " and business_article_info.Article_SerialNumber LIKE '%" + data.Article_SerialNumber + "%'\r\n"
            }
            // 根据商品名称筛选
            if (data.Supplier_Name) {
                SQL = SQL + " and business_supplier_info.Supplier_Name LIKE '%" + data.Supplier_Name + "%' \r\n"
            }
            // 根据品牌筛选
            if (data.Brand_SerialNumber) {
                SQL = SQL + " and business_article_info.Brand_SerialNumber LIKE '%" + data.Brand_SerialNumber + "%' \r\n"
            }
            if (this.business_article_classify.length> 0) {
                let str = "";
                this.business_article_classify.forEach(item =>{
                    if (str) {
                        str = str + " or business_article_classify.Classify_SerialNumber = '" + item[item.length - 1] + "' \r\n"
                    } else {
                        str = "business_article_classify.Classify_SerialNumber = '" + item[item.length - 1] + "' \r\n"
                    }
                   
                })
                SQL = SQL + " and (" + str + ") \r\n";
            }
            if (data.Purchase_Unit_Price1 > 0) {
                SQL = SQL + " and CAST(IFNULL(business_purchase_unitprice_detail.Purchase_Unit_Price,'0') As FLOAT) >= '" + data.Purchase_Unit_Price1 + "' \r\n"
            }
            if (data.Purchase_Unit_Price2 > 0) {
                SQL = SQL + " and CAST(IFNULL(business_purchase_unitprice_detail.Purchase_Unit_Price,'0') As FLOAT) <= '" + data.Purchase_Unit_Price2 + "' \r\n"
            }
            // data.Condition = window.btoa(unescape(encodeURIComponent("%" + data.Article_Name + "%")))
            // let SQL = "";
            // if (data.Brand_SerialNumber) {
            //     SQL = SQL + " and business_article_info.Brand_SerialNumber = '" + data.Brand_SerialNumber + "' "
            // }
            data.ExtensionCondition = window.btoa(unescape(encodeURIComponent(SQL)));
            $.ajax({
                headers: requestHeaders(),
                type: 'POST',
                url: `${BASE_URL2}/generalBusiness/generalPaginationQueryBySQLSerialNumber`,
                data,
                success: function (Result) {
                    that.tableData = Result.Rows;
                    that.total = Result.TotalRows;
                    that.table = false;
                    const timer = setTimeout(() => {
                        that.table = true;
                        clearTimeout(timer)
                    })
                },
                complete: function (XMLHttpRequest) {
                    requestPretreatment(XMLHttpRequest);
                },
                dataType: "json"
            });
        },
        Edit(Article_SerialNumber) {
            sessionStorage.setItem("Article_SerialNumber", Article_SerialNumber)
            window.location.href = './edit.html?Article_SerialNumber=' + Article_SerialNumber
        },
    },
})